package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 用户标签删除请求类
 *
 * @author hongyuhao
 * @version 2014年4月14日 - 下午5:16:10
 */
public class UserTagDeleteRequest extends Request {

	private int userId;
	
	private int tagId;
	
	/** */
	public UserTagDeleteRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		if(userId < 0) {
			throw new RequestIllegalException("缺少用户id号!");
		}
		
		this.tagId = requestInfo.getIntParameter(ApiUrlParamEnum.tagId.getParamName(), -1);
		if(tagId < 0) {
			throw new RequestIllegalException("缺少标签id号!");
		}
		
	}
	
	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}
	
	public int getTagId() {
		return tagId;
	}
	
	public void setTagId(int tagId) {
		this.tagId = tagId;
	}
}
